﻿namespace IBTrader.Modules.Configuration
{
    using System.Configuration;

    class EventElement : ConfigurationElement
    {
        [ConfigurationProperty("Source")]
        public string Source
        {
            get
            {
                return this["Source"] as string;
            }
        }
        [ConfigurationProperty("Target")]
        public string Target
        {
            get
            {
                return this["Target"] as string;
            }
        }
        [ConfigurationProperty("Event")]
        public string EventName
        {
            get
            {
                return this["Event"] as string;
            }
        }
        [ConfigurationProperty("Method")]
        public string Method
        {
            get
            {
                return this["Method"] as string;
            }
        }
        [ConfigurationProperty("Wrap", DefaultValue = false)]
        public bool Wrap
        {
            get
            {
                return (bool)this["Wrap"];
            }
        }
        public override string ToString()
        {
            return string.Format("{0} {1} {2} {3}", Source, EventName, Target, Method);
        }
    }
}
